home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
bipl.zip
/
PROGS.ZIP
/
SORTNAME.ICN
< prev
next >
Wrap
Text File
|
1992-11-26
|
684b
|
33 lines
############################################################################
#
# File: sortname.icn
#
# Subject: Program to order by last name
#
# Author: Ralph E. Griswold
#
# Date: May 22, 1992
#
###########################################################################
link namepfx, lastname
procedure main()
local names, line, last, first
names := table()
while line := read() do {
last := lastname(line)
first := namepfx(line)
/names[last] := set()
insert(names[last], first)
}
names := sort(names, 3)
while last := get(names) do
every write(!sort(get(names)), " ", last)
end